IOStream: Input/Output from file
wC++ has two basic classes to handle files, ifstream and ofstream. To use them, include the header file fstream.h.
ifstream handles file input (reading from files).
ofstream handles file output (writing to files). The way to declare an instance of the ifstream or ofstream class is:

ifstream a_file;
w //or
w ifstream a_file("filename");
In this case the constructor for both classes will actually open the file if you pass the name as an argument. As well, both classes have an open command (a_file.open()) and a close command (a_file.close()). It is generally a good idea to clean up after yourself and close files once you are finished.